<!DOCTYPE html >
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>供应商列表</title>
    <script type="application/javascript" th:src="@{/layui/layui.js}"></script>
    <script type="application/javascript" th:src="@{/js/jquery-3.6.0.js}"></script>
    <script type="application/javascript" th:src="@{/js/provider.js}"></script>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}"/>
    <link rel="stylesheet" th:href="@{/css/header.css}">
</head>
<body>

<div class="layui-layout layui-layout-admin">

    <div th:replace="~{commons/commons.html::header}"></div>


    <div th:replace="~{commons/commons.html::sider}"></div>

    <div class="layui-body" >
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <div class="layui-tab-content" style="height: 780px;padding: 0px;margin: 10px;" >
                <div class="layui-row">
                    <div class="layui-col-md2">
                        <ul class="layui-tab-title">
                            <li id="allUserBtn"  class="layui-this">供应商列表</li>
                        </ul>
                    </div>
                    <div class="layui-col-md2 layui-col-md-offset4">
                        <input id="scText" type="text" placeholder="请输入" class="layui-input" >
                    </div>
                    <div class="layui-col-md2">
                        <button id="scBtn" class="layui-btn" style="display: inline-block" onclick="fuzzyProvider()" >查询</button>
                    </div>
                    <div class="layui-col-md2">
                        <button class="layui-btn layui-btn-normal" id="addUser" onclick="addProvider()">添加供应商</button>
                    </div>

                </div>
                <div class="layui-tab-item layui-show">
                    <div id="providerSpace" th:fragment="providerSpace">
                        <table class="layui-table" >
                            <thead>
                            <tr>
                                <th>供应商编号</th>
                                <th>供应商名</th>
                                <th>供应商联系人</th>
                                <th>电话号码</th>
                                <th>传真</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr th:each="provider:${providerList}">
                                <td th:text="${provider.getProCode}"></td>
                                <td th:text="${provider.getProName}"></td>
                                <td th:text="${provider.getProContact}"></td>
                                <td th:text="${provider.getProPhone}"></td>
                                <td th:text="${provider.getProFax}"></td>
                                <td th:text="${#dates.format(provider.getCreationDate(), 'yyyy-MM-dd HH:mm:ss')}"></td>
                                <td>
                                    <a class="layui-btn" th:onclick="'javascript:providerDetails(\''+${provider.getId()}+'\');'">查看</a>
                                    <a class="layui-btn layui-btn-warm" th:onclick="'javascript:providerUpdate(\''+${provider.getId()}+'\');'">修改</a>
                                    <a class="layui-btn layui-btn-danger" th:onclick="'javascript:deleteProvider(\''+${provider.getId()}+'\');'">删除</a>
                                </td>
                            </tr>
                            </tbody>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--    <div th:replace="~{commons/commons.html::footer}"></div>-->

</div>

</body>

</html>